// Set styles for current pages

var pageNavHash = new Array();
pageNavHash["overview.html"] = "overview.html";
pageNavHash["whats_happening.html"] = "whats_happening.html";
pageNavHash["get_involved.html"] = "get_involved.html";

pageNavHash["events.html"] = "whats_happening.html";
pageNavHash["calendar.html"] = "whats_happening.html";

pageNavHash["past_projects.html"] = "overview.html";
pageNavHash["sponsors.html"] = "overview.html";

pageNavHash["youth_council.html"] = "get_involved.html";
pageNavHash["youth_link_board.html"] = "get_involved.html";
pageNavHash["action_teams.html"] = "get_involved.html";


function setNavState()
{
/* Set the top nav state */
$('#menu ul li').children('a').each(
	function()
	{
		var path = window.location.href;
		var loc = path.substring(path.lastIndexOf('/')+1);
		var url = $(this).attr('href');
		loc = pageNavHash[loc];
		if(url == loc)
		{
			$(this).addClass('current');
		}
	}
);

/* Set top nav sub menu state */
$('#sub-menu a').each(
	function()
	{
		var path = window.location.href;
		var loc = path.substring(path.lastIndexOf('/')+1);
		var url = $(this).attr('href');
		if(url == loc)
		{
			$(this).addClass('current');
		}
	}
);

/* Set top left nav menu state */
$('#left-navigation ul li a').each(
	function()
	{
		var path = window.location.href;
		var loc = path.substring(path.lastIndexOf('/')+1);
		var url = $(this).attr('href');
		if(url == loc)
		{
			$(this).addClass('current');
		}
	}
);

}


